package controller.KeyListeners;

import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.HashMap;

import javax.swing.KeyStroke;
import controller.Controller;
import controller.KeyConfig;
public class CycleKeyListener extends KeyboardListener{
    private Controller controller;
    private KeyConfig config;
	public CycleKeyListener(Controller c){
            setController(c);
            setConfig(config);
			keyBindings.put(KeyStroke.getKeyStroke(38,2), new Action(){
				//Code for Cycle next mode
				public void perform() {
					
                                        controller.cycleTypeDown();
					System.out.println("Cycle next mode");
				}
			});
			keyBindings.put(KeyStroke.getKeyStroke(40,2), new Action(){
				//THIS DOSENT FILE
				//Code for Cycle prev mode
				

				public void perform() {
                                        controller.cycleTypeUp();
					//System.out.println("Cycle prev mode");
				}
			});
			keyBindings.put(KeyStroke.getKeyStroke(37,2), new Action(){
				//TODO
				//Code for Cycle prev type
				public void perform() {
                                        controller.cycleSubTypeUp();
					System.out.println("Cycle prev type");
				}
			});
			keyBindings.put(KeyStroke.getKeyStroke(39,2), new Action(){
				//TODO
				//Code for Cycle next type
				public void perform() {
                                        controller.cycleSubTypeDown();
					System.out.println("Cycle next type");
				}
			});
			keyBindings.put(KeyStroke.getKeyStroke(38,0), new Action(){
				public void perform() {
                                        controller.cycleCommandDown();
				}
			});
			keyBindings.put(KeyStroke.getKeyStroke(40,0), new Action(){
				public void perform() {
                                        controller.cycleCommandUp();
				}
			});
			keyBindings.put(KeyStroke.getKeyStroke(37,0), new Action(){
				public void perform() {
                                        controller.cycleInstanceUp();
				}
			});
			keyBindings.put(KeyStroke.getKeyStroke(39,0), new Action(){
				//TODO
				//Code for Cycle next instance
				public void perform() {
                                        controller.cycleInstanceDown();
					System.out.println("Cycle next instance");
				}
			});
			
	}
        private void setController(Controller controller){
           this.controller = controller;
        }
        private void setConfig(KeyConfig config){
        	this.config = config;
        }
}
